package com.wbdgj.ui.branch;

import android.content.Context;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import com.wbdgj.R;
import com.wbdgj.base.BaseActivity;

import butterknife.BindView;

public class NetfeeRoamingSuccessActivity extends BaseActivity {

    private Context context = this;
    @BindView(R.id.msg)
    TextView msg;
    @Override
    protected int getLayoutResId() {
        return R.layout.ui_netfree_roaming_success;
    }

    @Override
    protected void initView() {
        msg.setText(getIntent().getStringExtra("msg"));
        findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                setResult(1);
                finish();
            }
        });
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK:
                setResult(1);
                finish();
                break;
//                return false;//拦截事件
            case KeyEvent.KEYCODE_MENU:
                Log.i("zp", "KeyEvent.KEYCODE_MENU");
                break;
            case KeyEvent.KEYCODE_HOME:
                Log.i("zp", "KeyEvent.KEYCODE_HOME");
                // 收不到
                break;
            case KeyEvent.KEYCODE_APP_SWITCH:
                Log.i("zp", "KeyEvent.KEYCODE_APP_SWITCH");
                // 收不到
                break;
            default:
                break;
        }

        return super.onKeyDown(keyCode, event);

    }
}
